package acwing._2LanQiao._13No13;
/**
 * @Project : AlgorithmLearning
 * @Package : ACWing._2LanQiao._13No13
 * @File : Q4644.java
 * @Author : WangRuoyu
 * @Date : 2023/3/30 16:08
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Q4644 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] words = br.readLine().split(" ");

        int n = Integer.parseInt(words[0]);
        words = br.readLine().split(" ");

        long sum = 0;
        long res = 0;
        for (int i = 0; i < n; ++i) {
            long x = Long.parseLong(words[i]);
            sum += x;
            res += x * x;
        }
        System.out.println((sum * sum - res)/2);
    }
}